home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / magazine / executive_v2.00 / data / register.lzx / Register.rexx < prev   
OS/2 REXX Batch file  |  2002-12-17  |  10KB  |  286 lines

  1. /*
  2.  * Fill in a registration form for Executive.
  3.  *
  4.  * Copyright © 1995-96 Petri Nordlund. All rights reserved.
  5.  *
  6.  * $Id: Register.rexx 1.5 1996/10/02 16:51:05 petrin Exp petrin $
  7.  *
  8.  */
  9.  
  10. regform = 'RAM:regform'
  11.  
  12. csi='9b'x;f.slant=csi'3m'; f.bold=csi'1m'; f.norm=csi'0m'
  13.              f.black=csi'31m'; f.white=csi'32m'; f.blue=csi'33m'
  14.              f.lf = '0a'x; f.cls = csi'0;0H'csi'J'
  15.  
  16. options prompt f.white'> 'f.black
  17.  
  18. payment1  = "Cash (please don't send coins)"
  19. payment2  = 'Eurocheque for 70 FIM'
  20. payment2a = '- you must write your card number on the back of the cheque'
  21. payment3  = 'Money transfer of 70 FIM to this account:'
  22. payment3a = '- bank: Postipankki Ltd, Helsinki, Finland'
  23. payment3b = '- account number 8000 29-26522193'
  24. payment3c = '- pay via Eurogiro or SWIFT'
  25. payment3d = '- SWIFT address: PSPBFIHH; Telex 121 698 pgiro fi'
  26. payment3e = '- include a copy of the receipt with this form'
  27. payment4  = 'Postal Money Order'
  28. payment4a = '- please mail or email this registration form to me'
  29. payment5  = 'Postiennakko (Finland only)'
  30. payment5a = '- postiennakkomaksu 20 mk lisätään hintaan (70+20=90 mk)'
  31.  
  32. cash1  = '$15 (US dollar)'
  33. cash4  = '£10 (Pound sterling)'
  34. cash2  = '20 CAD (Canadian dollar)'
  35. cash3  = '20 AUD (Australian dollar)'
  36. cash5  = '70 FIM (Finnish mark)'
  37. cash6  = '20 DEM (Deutsche mark)'
  38. cash7  = '100 NOK (Norwegian krone)'
  39. cash8  = '120 SEK (Swedish krona)'
  40. cash9  = '500 BEF (Belgian franc)'
  41. cash10  = '70 FRF (French franc)'
  42. cash11  = '25 NLG (Dutch guilder)'
  43. cash12 = '100 DKK (Danish krone)'
  44.  
  45. delivery1 = 'by airmail on a 3.5" disk'
  46. delivery2 = 'keyfile emailed to you'
  47.  
  48. say f.white
  49. say 'Welcome to Executive registration form generator.'
  50. say 'Now please answer all the questions. The registration form is written'
  51. say 'to file 'f.bold''regform''f.norm''f.white'. You can abort by pressing CTRL-C. When'
  52. say 'several lines are available for your answer, just hit ENTER on the'
  53. say 'lines you don''t need.'
  54. say f.black
  55.  
  56.  
  57. /* User */
  58. say 'What is your name?'
  59. parse pull i_Name
  60. say
  61.  
  62. say 'What is your full snailmail address (including country)? [5 lines available]'
  63. i_Addr1 = GetLine(1)
  64. i_Addr2 = GetLine(2)
  65. i_Addr3 = GetLine(3)
  66. i_Addr4 = GetLine(4)
  67. i_Addr5 = GetLine(5)
  68. say
  69.  
  70. say 'What is your Internet email address?'
  71. parse pull i_Email
  72. say
  73.  
  74. say 'Payment by:  1. 'payment1
  75. say '             2. 'payment2
  76. say '                'payment2a
  77. say '             3. 'payment3
  78. say '                'payment3a
  79. say '                'payment3b
  80. say '                'payment3c
  81. say '                'payment3d
  82. say '                'payment3e
  83. say '             4. 'payment4
  84. say '                'payment4a
  85. say '             5. 'payment5
  86. say '                'payment5a
  87. parse pull i_PaymentBy
  88. say
  89.  
  90. if i_PaymentBy = 1 then do
  91. say 'Currency:    1. 'cash1
  92. say '             2. 'cash2
  93. say '             3. 'cash3
  94. say '             4. 'cash4
  95. say '             5. 'cash5
  96. say '             6. 'cash6
  97. say '             7. 'cash7
  98. say '             8. 'cash8
  99. say '             9. 'cash9
  100. say '            10. 'cash10
  101. say '            11. 'cash11
  102. say '            12. 'cash12
  103. parse pull i_Currency
  104. say
  105. end
  106.  
  107. say 'Delivery:    1. 'delivery1
  108. say '             2. 'delivery2
  109. parse pull i_Delivery
  110. say
  111.  
  112. /* Write registration form */
  113.  
  114. outf = 'rffile'
  115. if open(outf,regform,'W') then do
  116.     call writeln(outf,'##    ## #####  ####  ##')
  117.     call writeln(outf,' ##  ##  ##    ##     ##')
  118.     call writeln(outf,'  ####   ####   ###   ##')
  119.     call writeln(outf,'   ##    ##       ##')
  120.     call writeln(outf,'   ##    ##### ####   ##    Please send me a keyfile for Executive!')
  121.     call writeln(outf,'___________________________________________________________________________' f.lf f.lf)
  122.     call writeln(outf,'Name:       'i_Name f.lf)
  123.     call writeln(outf,'Address:    'i_Addr1)
  124.     call writeln(outf,'            'i_Addr2)
  125.     call writeln(outf,'            'i_Addr3)
  126.     call writeln(outf,'            'i_Addr4)
  127.     call writeln(outf,'            'i_Addr5 f.lf)
  128.     call writeln(outf,'Email:      'i_Email f.lf)
  129.     call writeln(outf,'')
  130.  
  131.     if i_PaymentBy = 1 then do
  132.         call writeln(outf,'Payment by: [X] 'payment1)
  133.         if i_Currency = 1  then call writeln(outf,'                - 'cash1)
  134.         if i_Currency = 2  then call writeln(outf,'                - 'cash2)
  135.         if i_Currency = 3  then call writeln(outf,'                - 'cash3)
  136.         if i_Currency = 4  then call writeln(outf,'                - 'cash4)
  137.         if i_Currency = 5  then call writeln(outf,'                - 'cash5)
  138.         if i_Currency = 6  then call writeln(outf,'                - 'cash6)
  139.         if i_Currency = 7  then call writeln(outf,'                - 'cash7)
  140.         if i_Currency = 8  then call writeln(outf,'                - 'cash8)
  141.         if i_Currency = 9  then call writeln(outf,'                - 'cash9)
  142.         if i_Currency = 10 then call writeln(outf,'                - 'cash10)
  143.         if i_Currency = 11 then call writeln(outf,'                - 'cash11)
  144.         if i_Currency = 12 then call writeln(outf,'                - 'cash12)
  145.         call writeln(outf,'            [ ] 'payment2)
  146.         call writeln(outf,'                'payment2a)
  147.         call writeln(outf,'            [ ] 'payment3)
  148.         call writeln(outf,'                'payment3a)
  149.         call writeln(outf,'                'payment3b)
  150.         call writeln(outf,'                'payment3c)
  151.         call writeln(outf,'                'payment3d)
  152.         call writeln(outf,'                'payment3e)
  153.         call writeln(outf,'            [ ] 'payment4)
  154.         call writeln(outf,'                'payment4a)
  155.         call writeln(outf,'            [ ] 'payment5)
  156.         call writeln(outf,'                'payment5a)
  157.         end
  158.  
  159.     if i_PaymentBy = 2 then do
  160.         call writeln(outf,'Payment by: [ ] 'payment1)
  161.         call writeln(outf,'            [X] 'payment2)
  162.         call writeln(outf,'                'payment2a)
  163.         call writeln(outf,'            [ ] 'payment3)
  164.         call writeln(outf,'                'payment3a)
  165.         call writeln(outf,'                'payment3b)
  166.         call writeln(outf,'                'payment3c)
  167.         call writeln(outf,'                'payment3d)
  168.         call writeln(outf,'                'payment3e)
  169.         call writeln(outf,'            [ ] 'payment4)
  170.         call writeln(outf,'                'payment4a)
  171.         call writeln(outf,'            [ ] 'payment5)
  172.         call writeln(outf,'                'payment5a)
  173.         end
  174.  
  175.     if i_PaymentBy = 3 then do
  176.         call writeln(outf,'Payment by: [ ] 'payment1)
  177.         call writeln(outf,'            [ ] 'payment2)
  178.         call writeln(outf,'                'payment2a)
  179.         call writeln(outf,'            [X] 'payment3)
  180.         call writeln(outf,'                'payment3a)
  181.         call writeln(outf,'                'payment3b)
  182.         call writeln(outf,'                'payment3c)
  183.         call writeln(outf,'                'payment3d)
  184.         call writeln(outf,'                'payment3e)
  185.         call writeln(outf,'            [ ] 'payment4)
  186.         call writeln(outf,'                'payment4a)
  187.         call writeln(outf,'            [ ] 'payment5)
  188.         call writeln(outf,'                'payment5a)
  189.         end
  190.  
  191.     if i_PaymentBy = 4 then do
  192.         call writeln(outf,'Payment by: [ ] 'payment1)
  193.         call writeln(outf,'            [ ] 'payment2)
  194.         call writeln(outf,'                'payment2a)
  195.         call writeln(outf,'            [ ] 'payment3)
  196.         call writeln(outf,'                'payment3a)
  197.         call writeln(outf,'                'payment3b)
  198.         call writeln(outf,'                'payment3c)
  199.         call writeln(outf,'                'payment3d)
  200.         call writeln(outf,'                'payment3e)
  201.         call writeln(outf,'            [X] 'payment4)
  202.         call writeln(outf,'                'payment4a)
  203.         call writeln(outf,'            [ ] 'payment5)
  204.         call writeln(outf,'                'payment5a)
  205.         end
  206.  
  207.     if i_PaymentBy = 5 then do
  208.         call writeln(outf,'Payment by: [ ] 'payment1)
  209.         call writeln(outf,'            [ ] 'payment2)
  210.         call writeln(outf,'                'payment2a)
  211.         call writeln(outf,'            [ ] 'payment3)
  212.         call writeln(outf,'                'payment3a)
  213.         call writeln(outf,'                'payment3b)
  214.         call writeln(outf,'                'payment3c)
  215.         call writeln(outf,'                'payment3d)
  216.         call writeln(outf,'                'payment3e)
  217.         call writeln(outf,'            [ ] 'payment4)
  218.         call writeln(outf,'                'payment4a)
  219.         call writeln(outf,'            [X] 'payment5)
  220.         call writeln(outf,'                'payment5a)
  221.         end
  222.  
  223.     call writeln(outf,f.lf)
  224.  
  225.     if i_Delivery = 1 then do
  226.     call writeln(outf,'Delivery:   [X] 'delivery1)
  227.     call writeln(outf,'            [ ] 'delivery2)
  228.     end
  229.     else do
  230.     call writeln(outf,'Delivery:   [ ] 'delivery1)
  231.     call writeln(outf,'            [X] 'delivery2)
  232.     end
  233.  
  234.     call writeln(outf,f.lf f.lf)
  235.     call writeln(outf,'Registration date:' date() f.lf f.lf f.lf f.lf)
  236.     call writeln(outf,'______________________________________')
  237.     call writeln(outf,'signature' f.lf)
  238.     call writeln(outf,'Thank you for registering Executive!' f.lf)
  239.     call writeln(outf,'___________________________________________________________________________')
  240.     call writeln(outf,'Petri Nordlund      email: petrin@megabaud.fi')
  241.     call writeln(outf,'Vanhamaantie 4             petrin@vtoy.fi')
  242.     call writeln(outf,'FIN-28800  PORI')
  243.     call writeln(outf,'FINLAND             WWW:   http://www.megabaud.fi/~petrin/Executive.html')
  244.  
  245. say 'The registration form has been written to file 'f.bold''regform''f.norm'.'
  246. say 'This file is a normal ASCII file, so you can edit it with a text'
  247. say 'editor if necessary.'
  248.  
  249. say f.white f.slant
  250. say 'Thank you for registering Executive!' f.norm f.black f.lf
  251.  
  252. end
  253. else
  254.     signal error_file
  255.  
  256. address command 'delete RAM:_regform.tmp >NIL:'
  257.  
  258. exit 0
  259. /* MAIN PROGRAM ENDS HERE, PROCEDURES FOLLOW */
  260.  
  261. /* Failed when trying to write the registration form file */
  262. error_file:
  263.   say f.white f.bold
  264.   say 'Can''t write file "'regform'".'
  265.   say f.norm f.black
  266.   exit 20
  267.  
  268.  
  269. /* GetRes */
  270. GetRes:
  271.   if open(6Res, 'RAM:_regform.tmp', 'R') then do
  272.     Res = readln(6Res)
  273.     call close 6Res
  274.   end
  275.   else
  276.     Res = ''
  277.   return Res
  278.  
  279.  
  280. /* GetLine */
  281. GetLine:
  282.   options prompt f.white''arg(1)'> 'f.black
  283.   parse pull str
  284.   options prompt f.white'> 'f.black
  285.   return str
  286.